package com.hy.study;

import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * @author huyong
 * @date 2024 年 01 月 03 日 10:47: 11
 */
@Component
public class TestComponent implements ApplicationContextAware, BeanNameAware {
    private ApplicationContext applicationContext;
    private final static Logger log = Logger.getLogger(TestComponent.class);

    @Override
    public void setBeanName(String beanName) {
        log.info("current bean name is :" + beanName);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }
}
